package com.aaa.a1105第三遍.demo02;

import java.util.Arrays;
import java.util.Optional;

/**
 * @author 荆豪峰
 * @version 1.0
 */
public class Test04 {
    public static void main(String[] args) {
        Integer[] arr={5,74,22,25,7};

        Optional<Integer> reduce = Arrays.stream(arr).reduce((t1, t2) -> t1 + t2);
        System.out.println(reduce.get());
    }
}
